home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / PowerFantasm™ 4.19a / Beginners guide / Beginners Mac Assembly - ed.srd / Beginners Mac Assembly - ed.srd.rsrc / PICT_49.png < prev    next >
Portable Network Graphic  |  1996-08-28  |  67KB  |  816x1056  |  8-bit (256 colors)
OCR: SADRL AY: 1996 EQU SB805ers Guide To Macintosh Assembly Language Programming 4Bage START: MOVEM.L A5-A6, -(SP) SAVE MAC WORLDline BSR LOAD SOUND LOADIN OUR SOUND line 2 BSR DO SOUND PLAY IT line MOVEM.L SP)+ A5-A6 RESTORE REGISTERS line 4 RTS BYE line Now its far easier to see what's going on. We save the important registers sound, play it restore the registers and leave. This Is called the main loop (although in this case. there 'is no loop) The reason its called loop because normally program will initialise everything, then continuously loop around a main loop waiting for things to happen. The more readable the main loop iS. the easier it Is to follow what Is happening. Here Fantasm main loop: MAIN LOOP LOOP BSR TST.W EVENTS DO *check for *events something returns in do happen BEQ.S LOOP ...